""" 
CSDN : heart_6662
PYTHON amateur   
"""
board = [["X",".",".","X"],[".",".",".","X"],[".",".",".","X"]]

row = len(board)
col = len(board[0])
res =  0
for i in range(row):
    for j in range(col):
        if board[i][j] == ".": continue
        if i > 0 and board[i - 1][j] == "X": continue
        if j > 0 and board[i][j - 1] == "X": continue
        res += 1